package com.qpf.mycms.api.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.Getter;

@Getter
public enum HttpStatusEnum implements IEnum<Integer> {
    SUCCESS(200, "成功"),
    CREATED(201, "创建成功"),
    ACCEPTED(202, "请求已经被接收"),
    NO_CONTENT(204, "无内容"),
    MOVED_PERM(301, "永久移动"),
    SEE_OTHER(303, "重定向"),
    NOT_MODIFIED(304, "未修改"),
    BAD_REQUEST(400, "请求错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "访问受限,授权过期"),
    NOT_FOUND(404, "未找到"),
    BAD_METHOD(405, "方法不允许"),
    CONFLICT(409, "资源冲突"),
    GONE(410, "资源已删除"),
    PRECONDITION_FAILED(412, "前置条件失败"),
    UNSUPPORTED_MEDIA_TYPE(415, "不支持的媒体类型"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    NOT_IMPLEMENTED(501, "接口未实现"),
    ERROR(500, "系统内部错误"),
    WARN(601, "系统内部警告"),
    ;
    private final Integer value;
    private final String desc;
    HttpStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }
}
